/*
 * Copyright (c) 2005-2006 Derelict Developers
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 *
 * * Neither the names 'Derelict', 'DerelictIL', nor the names of its contributors
 *   may be used to endorse or promote products derived from this software
 *   without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
module derelict.devil.iltypes;

alias uint      ILenum;
alias ubyte     ILboolean;
alias uint      ILbitfield;
alias char      ILbyte;
alias short     ILshort;
alias int       ILint;
alias int       ILsizei;
alias ubyte     ILubyte;
alias ushort    ILushort;
alias uint      ILuint;
alias float     ILfloat;
alias float     ILclampf;
alias double    ILdouble;
alias double    ILclampd;
alias void      ILvoid;

//alias wchar_t*    ILstring;
alias char* ILstring;


const ILuint IL_FALSE=0;
const ILuint IL_TRUE=1;


// Matches OpenGL's right now.
const ILuint IL_COLOUR_INDEX=0x1900;
const ILuint IL_COLOR_INDEX=0x1900;
const ILuint IL_RGB=0x1907;
const ILuint IL_RGBA=0x1908;
const ILuint IL_BGR=0x80E0;
const ILuint IL_BGRA=0x80E1;
const ILuint IL_LUMINANCE=0x1909;
const ILuint IL_LUMINANCE_ALPHA=0x190A;


const ILuint IL_BYTE=0x1400;
const ILuint IL_UNSIGNED_BYTE=0x1401;
const ILuint IL_SHORT=0x1402;
const ILuint IL_UNSIGNED_SHORT=0x1403;
const ILuint IL_INT=0x1404;
const ILuint IL_UNSIGNED_INT=0x1405;
const ILuint IL_FLOAT=0x1406;
const ILuint IL_DOUBLE=0x140A;


const ILuint IL_VENDOR=0x1F00;
const ILuint IL_LOAD_EXT=0x1F01;
const ILuint IL_SAVE_EXT=0x1F02;


//
// IL-specific//

const ILuint IL_VERSION_1_6_7=1;
const ILuint IL_VERSION=167;


// Attribute Bits
const ILuint IL_ORIGIN_BIT=0x00000001;
const ILuint IL_FILE_BIT=0x00000002;
const ILuint IL_PAL_BIT=0x00000004;
const ILuint IL_FORMAT_BIT=0x00000008;
const ILuint IL_TYPE_BIT=0x00000010;
const ILuint IL_COMPRESS_BIT=0x00000020;
const ILuint IL_LOADFAIL_BIT=0x00000040;
const ILuint IL_FORMAT_SPECIFIC_BIT=0x00000080;
const ILuint IL_ALL_ATTRIB_BITS=0x000FFFFF;


// Palette types
const ILuint IL_PAL_NONE=0x0400;
const ILuint IL_PAL_RGB24=0x0401;
const ILuint IL_PAL_RGB32=0x0402;
const ILuint IL_PAL_RGBA32=0x0403;
const ILuint IL_PAL_BGR24=0x0404;
const ILuint IL_PAL_BGR32=0x0405;
const ILuint IL_PAL_BGRA32=0x0406;


// Image types
const ILuint IL_TYPE_UNKNOWN=0x0000;
const ILuint IL_BMP=0x0420;
const ILuint IL_CUT=0x0421;
const ILuint IL_DOOM=0x0422;
const ILuint IL_DOOM_FLAT=0x0423;
const ILuint IL_ICO=0x0424;
const ILuint IL_JPG=0x0425;
const ILuint IL_JFIF=0x0425;
const ILuint IL_LBM=0x0426;
const ILuint IL_PCD=0x0427;
const ILuint IL_PCX=0x0428;
const ILuint IL_PIC=0x0429;
const ILuint IL_PNG=0x042A;
const ILuint IL_PNM=0x042B;
const ILuint IL_SGI=0x042C;
const ILuint IL_TGA=0x042D;
const ILuint IL_TIF=0x042E;
const ILuint IL_CHEAD=0x042F;
const ILuint IL_RAW=0x0430;
const ILuint IL_MDL=0x0431;
const ILuint IL_WAL=0x0432;
const ILuint IL_LIF=0x0434;
const ILuint IL_MNG=0x0435;
const ILuint IL_JNG=0x0435;
const ILuint IL_GIF=0x0436;
const ILuint IL_DDS=0x0437;
const ILuint IL_DCX=0x0438;
const ILuint IL_PSD=0x0439;
const ILuint IL_EXIF=0x043A;
const ILuint IL_PSP=0x043B;
const ILuint IL_PIX=0x043C;
const ILuint IL_PXR=0x043D;
const ILuint IL_XPM=0x043E;

const ILuint IL_JASC_PAL=0x0475;


// Error Types
const ILuint IL_NO_ERROR=0x0000;
const ILuint IL_INVALID_ENUM=0x0501;
const ILuint IL_OUT_OF_MEMORY=0x0502;
const ILuint IL_FORMAT_NOT_SUPPORTED=0x0503;
const ILuint IL_INTERNAL_ERROR=0x0504;
const ILuint IL_INVALID_VALUE=0x0505;
const ILuint IL_ILLEGAL_OPERATION=0x0506;
const ILuint IL_ILLEGAL_FILE_VALUE=0x0507;
const ILuint IL_INVALID_FILE_HEADER=0x0508;
const ILuint IL_INVALID_PARAM=0x0509;
const ILuint IL_COULD_NOT_OPEN_FILE=0x050A;
const ILuint IL_INVALID_EXTENSION=0x050B;
const ILuint IL_FILE_ALREADY_EXISTS=0x050C;
const ILuint IL_OUT_FORMAT_SAME=0x050D;
const ILuint IL_STACK_OVERFLOW=0x050E;
const ILuint IL_STACK_UNDERFLOW=0x050F;
const ILuint IL_INVALID_CONVERSION=0x0510;
const ILuint IL_BAD_DIMENSIONS=0x0511;
const ILuint IL_FILE_READ_ERROR=0x0512;  // 05/12/2002: Addition by Sam.
const ILuint IL_FILE_WRITE_ERROR=0x0512;

const ILuint IL_LIB_GIF_ERROR=0x05E1;
const ILuint IL_LIB_JPEG_ERROR=0x05E2;
const ILuint IL_LIB_PNG_ERROR=0x05E3;
const ILuint IL_LIB_TIFF_ERROR=0x05E4;
const ILuint IL_LIB_MNG_ERROR=0x05E5;
const ILuint IL_UNKNOWN_ERROR=0x05FF;


// Origin Definitions
const ILuint IL_ORIGIN_SET=0x0600;
const ILuint IL_ORIGIN_LOWER_LEFT=0x0601;
const ILuint IL_ORIGIN_UPPER_LEFT=0x0602;
const ILuint IL_ORIGIN_MODE=0x0603;


// Format and Type Mode Definitions
const ILuint IL_FORMAT_SET=0x0610;
const ILuint IL_FORMAT_MODE=0x0611;
const ILuint IL_TYPE_SET=0x0612;
const ILuint IL_TYPE_MODE=0x0613;


// File definitions
const ILuint IL_FILE_OVERWRITE=0x0620;
const ILuint IL_FILE_MODE=0x0621;


// Palette definitions
const ILuint IL_CONV_PAL=0x0630;


// Load fail definitions
const ILuint IL_DEFAULT_ON_FAIL=0x0632;


// Key colour definitions
const ILuint IL_USE_KEY_COLOUR=0x0635;
const ILuint IL_USE_KEY_COLOR=0x0635;


// Interlace definitions
const ILuint IL_SAVE_INTERLACED=0x0639;
const ILuint IL_INTERLACE_MODE=0x063A;


// Quantization definitions
const ILuint IL_QUANTIZATION_MODE=0x0640;
const ILuint IL_WU_QUANT=0x0641;
const ILuint IL_NEU_QUANT=0x0642;
const ILuint IL_NEU_QUANT_SAMPLE=0x0643;
const ILuint IL_MAX_QUANT_INDEXS=0x0644;    //XIX : ILint : Maximum number of colors to reduce to, default of 256. and has a range of 2-256


// Hints
const ILuint IL_FASTEST=0x0660;
const ILuint IL_LESS_MEM=0x0661;
const ILuint IL_DONT_CARE=0x0662;
const ILuint IL_MEM_SPEED_HINT=0x0665;
const ILuint IL_USE_COMPRESSION=0x0666;
const ILuint IL_NO_COMPRESSION=0x0667;
const ILuint IL_COMPRESSION_HINT=0x0668;


// Subimage types
const ILuint IL_SUB_NEXT=0x0680;
const ILuint IL_SUB_MIPMAP=0x0681;
const ILuint IL_SUB_LAYER=0x0682;


// Compression definitions
const ILuint IL_COMPRESS_MODE=0x0700;
const ILuint IL_COMPRESS_NONE=0x0701;
const ILuint IL_COMPRESS_RLE=0x0702;
const ILuint IL_COMPRESS_LZO=0x0703;
const ILuint IL_COMPRESS_ZLIB=0x0704;


// File format-specific values
const ILuint IL_TGA_CREATE_STAMP=0x0710;
const ILuint IL_JPG_QUALITY=0x0711;
const ILuint IL_PNG_INTERLACE=0x0712;
const ILuint IL_TGA_RLE=0x0713;
const ILuint IL_BMP_RLE=0x0714;
const ILuint IL_SGI_RLE=0x0715;
const ILuint IL_TGA_ID_STRING=0x0717;
const ILuint IL_TGA_AUTHNAME_STRING=0x0718;
const ILuint IL_TGA_AUTHCOMMENT_STRING=0x0719;
const ILuint IL_PNG_AUTHNAME_STRING=0x071A;
const ILuint IL_PNG_TITLE_STRING=0x071B;
const ILuint IL_PNG_DESCRIPTION_STRING=0x071C;
const ILuint IL_TIF_DESCRIPTION_STRING=0x071D;
const ILuint IL_TIF_HOSTCOMPUTER_STRING=0x071E;
const ILuint IL_TIF_DOCUMENTNAME_STRING=0x071F;
const ILuint IL_TIF_AUTHNAME_STRING=0x0720;
const ILuint IL_JPG_SAVE_FORMAT=0x0721;
const ILuint IL_CHEAD_HEADER_STRING=0x0722;
const ILuint IL_PCD_PICNUM=0x0723;

const ILuint IL_PNG_ALPHA_INDEX=0x0724; //XIX : ILint : the color in the pallete at this index value (0-255) is considered transparent, -1 for no trasparent color

// DXTC definitions
const ILuint IL_DXTC_FORMAT=0x0705;
const ILuint IL_DXT1=0x0706;
const ILuint IL_DXT2=0x0707;
const ILuint IL_DXT3=0x0708;
const ILuint IL_DXT4=0x0709;
const ILuint IL_DXT5=0x070A;
const ILuint IL_DXT_NO_COMP=0x070B;
const ILuint IL_KEEP_DXTC_DATA=0x070C;
const ILuint IL_DXTC_DATA_FORMAT=0x070D;


// Cube map definitions
const ILuint IL_CUBEMAP_POSITIVEX=0x00000400;
const ILuint IL_CUBEMAP_NEGATIVEX=0x00000800;
const ILuint IL_CUBEMAP_POSITIVEY=0x00001000;
const ILuint IL_CUBEMAP_NEGATIVEY=0x00002000;
const ILuint IL_CUBEMAP_POSITIVEZ=0x00004000;
const ILuint IL_CUBEMAP_NEGATIVEZ=0x00008000;


// Values
const ILuint IL_VERSION_NUM=0x0DE2;
const ILuint IL_IMAGE_WIDTH=0x0DE4;
const ILuint IL_IMAGE_HEIGHT=0x0DE5;
const ILuint IL_IMAGE_DEPTH=0x0DE6;
const ILuint IL_IMAGE_SIZE_OF_DATA=0x0DE7;
const ILuint IL_IMAGE_BPP=0x0DE8;
const ILuint IL_IMAGE_BYTES_PER_PIXEL=0x0DE8;
const ILuint IL_IMAGE_BITS_PER_PIXEL=0x0DE9;
const ILuint IL_IMAGE_FORMAT=0x0DEA;
const ILuint IL_IMAGE_TYPE=0x0DEB;
const ILuint IL_PALETTE_TYPE=0x0DEC;
const ILuint IL_PALETTE_SIZE=0x0DED;
const ILuint IL_PALETTE_BPP=0x0DEE;
const ILuint IL_PALETTE_NUM_COLS=0x0DEF;
const ILuint IL_PALETTE_BASE_TYPE=0x0DF0;
const ILuint IL_NUM_IMAGES=0x0DF1;
const ILuint IL_NUM_MIPMAPS=0x0DF2;
const ILuint IL_NUM_LAYERS=0x0DF3;
const ILuint IL_ACTIVE_IMAGE=0x0DF4;
const ILuint IL_ACTIVE_MIPMAP=0x0DF5;
const ILuint IL_ACTIVE_LAYER=0x0DF6;
const ILuint IL_CUR_IMAGE=0x0DF7;
const ILuint IL_IMAGE_DURATION=0x0DF8;
const ILuint IL_IMAGE_PLANESIZE=0x0DF9;
const ILuint IL_IMAGE_BPC=0x0DFA;
const ILuint IL_IMAGE_OFFX=0x0DFB;
const ILuint IL_IMAGE_OFFY=0x0DFC;
const ILuint IL_IMAGE_CUBEFLAGS=0x0DFD;
const ILuint IL_IMAGE_ORIGIN=0x0DFE;


const ILint IL_SEEK_SET=0;
const ILint IL_SEEK_CUR=1;
const ILint IL_SEEK_END=2;
const ILint IL_EOF=1;
